package inet.app.model.lottery;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Vector;

public class LotteryResult {
	private String code;
	private String eighth;
	private String fifth;
	private String first;
	private String fourth;
	private BigDecimal id;
	private Timestamp lastUpdated;
	private Timestamp open_date;
	private BigDecimal price;
	private String second;
	private String seventh;
	private String sixth;
	private String special;
	private int status;
	private String symbol;
	private String third;
	private String userName;
	private static Vector<String> xsMienBacCodes = new Vector<String>();

	static {
		xsMienBacCodes.add("XSTD");
		xsMienBacCodes.add("XSBN");
		xsMienBacCodes.add("XSHP");
		xsMienBacCodes.add("XSQN");
		xsMienBacCodes.add("XSND");
		xsMienBacCodes.add("XSTB");
	}

	public LotteryResult(String giaia) {
		this.code = giaia;
	}

	public LotteryResult(String special, String first, String second,
			String third, String fourth, String fifth, String sixth,
			String seventh) {
		super();
		this.fifth = fifth;
		this.first = first;
		this.fourth = fourth;
		this.second = second;
		this.seventh = seventh;
		this.sixth = sixth;
		this.special = special;
		this.third = third;
	}

	public LotteryResult(String cuoi, String db) {
		super();
		this.fifth = db;
		this.eighth = cuoi;
	}

	public LotteryResult(String db, String g7, String g8) {
		super();
		this.fifth = db;
		this.seventh = g7;
		this.eighth = g8;
	}

	public LotteryResult(String special, String first, String second,
			String third, String fourth, String fifth, String sixth,
			String seventh, String eighth) {
		super();
		this.fifth = fifth;
		this.first = first;
		this.fourth = fourth;
		this.second = second;

		this.seventh = seventh;
		this.sixth = sixth;
		this.special = special;
		this.third = third;
		this.eighth = eighth;
	}

	public LotteryResult(BigDecimal id, String code, String symbol,
			BigDecimal price, Timestamp open_date, String special,
			String first, String second, String third, String fourth,
			String fifth, String sixth, String seventh, String eighth,
			int status) {
		this.id = id;
		this.code = code;
		this.symbol = symbol;
		this.price = price;
		this.open_date = open_date;
		this.special = special;
		this.first = first;
		this.second = second;
		this.third = third;
		this.fourth = fourth;
		this.fifth = fifth;
		this.sixth = sixth;
		this.seventh = seventh;
		this.eighth = eighth;
		this.status = status;

	}

	public String getCode() {
		return this.code;
	}

	public String getEighth() {
		return this.eighth;
	}

	public String getFifth() {
		return this.fifth;
	}

	public String getFirst() {
		return this.first;
	}

	public String getFourth() {
		return this.fourth;
	}

	public BigDecimal getId() {
		return this.id;
	}

	public Timestamp getLastUpdated() {
		return this.lastUpdated;
	}

	public Timestamp getOpen_date() {
		return this.open_date;
	}

	public BigDecimal getPrice() {
		return this.price;
	}

	public String getSecond() {
		return this.second;
	}

	public String getSeventh() {
		return this.seventh;
	}

	public String getSixth() {
		return this.sixth;
	}

	public String getSpecial() {
		return this.special;
	}

	public int getStatus() {
		return this.status;
	}

	public String getSymbol() {
		return this.symbol;
	}

	public String getThird() {
		return this.third;
	}

	public boolean hasFullResult() {
		return ((this.special != null) && (this.first != null)
				&& (this.second != null) && (this.third != null)
				&& (this.fourth != null) && (this.fifth != null)
				&& (this.sixth != null) && (this.seventh != null)
				&& (this.special.indexOf("null") < 0) && (this.seventh
				.indexOf("null") < 0));
	}

	public boolean hasFullResultButSpecial() {
		return ((this.seventh != null) && (this.seventh.indexOf("null") < 0) && (((this.special == null) || (this.special
				.indexOf("null") >= 0))));
	}

	public boolean hasHalfResult() {
		return ((((this.special == null) || (this.special.indexOf("null") >= 0)))
				&& (this.sixth != null) && (this.sixth.indexOf("null") < 0));
	}

	public boolean isXoSoMienBac() {
		return xsMienBacCodes.contains(this.code);
	}

	public void setCode(String value) {
		if (value != null)
			value = value.toUpperCase();
		this.code = value;
	}

	public void setEighth(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.eighth = value;
	}

	public void setFifth(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.fifth = value;
	}

	public void setFirst(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.first = value;
	}

	public void setFourth(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.fourth = value;
	}

	public void setId(BigDecimal id) {
		this.id = id;
	}

	public void setLastUpdated(Timestamp value) {
		this.lastUpdated = value;
	}

	public void setOpen_date(Timestamp open_date) {
		this.open_date = open_date;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public void setSecond(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.second = value;
	}

	public void setSeventh(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.seventh = value;
	}

	public void setSixth(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.sixth = value;
	}

	public void setSpecial(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.special = value;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public void setSymbol(String symbol) {
		this.symbol = symbol;
	}

	public void setThird(String value) {
		if ("null".equalsIgnoreCase(value))
			value = null;

		this.third = value;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
}